﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ITAP.Core.Modelling;


namespace ITAP.ContourBuilder.GUI
{
    public partial class FormElementProperties : Form
    {
        public double OffsetValue
        {
            get
            {
                return (double)numericUpDownOffsetValue.Value;
            }
            set
            {
                numericUpDownOffsetValue.Value = (decimal)value;
            }
        }

        public double Height
        {
            get
            {
                return (double)numericUpDownArcHeight.Value;
            }
            set
            {
                numericUpDownArcHeight.Value = (decimal)value;
            }
        }

        public ModelPoint StartPoint
        {
            get
            {
                return new ModelPoint((double)numericUpDownStartX.Value, (double)numericUpDownStartY.Value);
            }
            set
            {
                numericUpDownStartX.Value = (decimal)value.X;
                numericUpDownStartY.Value = (decimal)value.Y;
            }
        }

        public ModelPoint EndPoint
        {
            get
            {
                return new ModelPoint((double)numericUpDownEndX.Value, (double)numericUpDownEndY.Value);
            }
            set
            {
                numericUpDownEndX.Value = (decimal)value.X;
                numericUpDownEndY.Value = (decimal)value.Y;
            }
        }

        public FormElementProperties()
        {
            InitializeComponent();
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
